﻿using System;
using System.Collections.Generic;
using System.Web;

namespace PAS.Helper
{
    
        /// <summary>
        /// javascript Alert 
        /// </summary>
        public sealed class Alert : System.Web.UI.Page
        {
            /// <summary>
            /// javaScript的弹出消息框
            /// </summary>
            /// <param name="showValue">输出内容</param>
            public static void MessageBox(string showValue)
            {
                if (!string.IsNullOrEmpty(showValue))
                    showValue = showValue.Replace("\r\n", "\\r\\n");
                HttpContext.Current.Response.Write("<script language='javascript' type='text/javascript'>alert('" + showValue + "');</script>");
            }



            /// <summary>
            /// 输出内容页面字体不变形的解决方案
            /// </summary>
            /// <param name="page"></param>
            /// <param name="values"></param>
            public static void WebMessageBox(System.Web.UI.Page page, string values)
            {
                page.ClientScript.RegisterClientScriptBlock(typeof(string), "信息提示", "<script language='javascript'>alert(\"" + values + "\")</script>");
            }


        }
    
}
